<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>个人信息</title>

    <!--在线引用JQuery-->
    <script src="https://code.jquery.com/jquery-3.1.1.js"></script>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css"
          integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
            crossorigin="anonymous"></script>
</head>

<style>
    #userBackGroundImage {
        width: 100%;
        height: 100px;
        background: #2ECC71;
    }

    #userHeader {
        width: 100px;
        height: 100px;
    }

    #userInfo {
        text-align: center;
        color: #2ECC71;
    }
</style>

<body>

<!--导航条-->
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">个人图标</a>
        </div>


        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a th:href="@{/}">首页</a></li>
                <li><a href="#">咸鱼广场</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">咸鱼工作<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">IT</a></li>
                        <li><a href="#">金融</a></li>
                        <li><a href="#">服务</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">销售</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">土木</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <label>
                        <input type="text" class="form-control" placeholder="天安门招聘保安,熟手优先">
                    </label>
                </div>
                <button type="submit" class="btn btn-default">Get it</button>
            </form>

            <ul class="nav navbar-nav navbar-right">
                <li><a th:href="@{/ajax/toLogin}" th:if="${userName==null}">登陆</a></li>
                <li><a th:href="@{/ajax/toRegister}">注册</a></li>
                <li><a th:href="@{/ajax/exit}" th:if="${userName!=null}">注销</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">我的账户<span class="sr-only">(current)</span><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li class="active"><a th:href="@{/user/toMyInfo}">个人信息</a></li>
                        <li><a th:href="@{/user/toUpdateUserInfo}">修改个人信息</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<!--<img id="userBackGroundImage" alt="..." src="/static/image/userBackground.jpg"/>-->

<div id="userInfo" class="panel panel-default">
    <table class="table">
        <tr>
            <td>
                <img id="userHeader" th:src="@{/user/getUserHeader(pageNumber=1)}" alt="您未上传头像哦!">
            </td>
        </tr>
        <tr>
            <td>
                <p th:text="'用户名：'+${currentUser.getUserName()}"></p>
            </td>
        </tr>
        <tr>
            <td>
                <p th:text="'初始日期：'+${currentUser.getCreateTime()}"></p>
            </td>
        </tr>
        <tr>
            <td>
                <p th:text="'邮箱：'+${currentUser.getUserEmail()}"></p>
            </td>
        </tr>
    </table>
</div>


<!--上传头像-->
<form id="uploadUserHeaderForm" th:action="@{/user/uploadUserHeader}" method="post" enctype="multipart/form-data">
    <input name="file" type="file"><br>
    <button type="submit">上传头像</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</form>
</body>
</html>